package one.four.eight;

import java.util.Arrays;

public class TheEqual {

	public static int count(int[] a) {
		int ct = 0;
		int s = a[0];
		Arrays.sort(a);

		for (int i = 1; i < a.length; i++) {
			if (s == a[i]) {
				ct++;
			} else {
				s = a[i];
			}
		}
		return ct;
	}

	public static void main(String[] args) {
		int[] a = { 1, 4, 2, 3, 1, 4, 5 };
		int r = count(a);
		System.out.println(r);

	}

}
